﻿using UnityEngine;
using UnityEngine.Playables;
using UnityEngine.Timeline;

namespace Pvp.Timeline
{
    [TrackClipType(typeof(RoleTransformAsset))]
    [TrackClipType(typeof(RoleMoveControlAsset))]
    [TrackClipType(typeof(RoleAttackBoxAsset))]
    [TrackClipType(typeof(RoleHurtBoxAsset))]
    [TrackClipType(typeof(RoleAnimationAsset))]
    [TrackClipType(typeof(RoleAnimationStateAsset))]
    [TrackClipType(typeof(RoleLimitControlAsset))]
    [TrackClipType(typeof(RoleNoboxAttackAsset))]
    [TrackBindingType(typeof(FightUnitEntity))]
    public class RoleSkillTrack : TrackAsset
    {
        protected override Playable CreatePlayable(PlayableGraph graph, GameObject gameObject, TimelineClip clip)
        {
            var type = clip.asset.GetType();
            if (type.Equals(typeof(RoleHurtBoxAsset)))
            {
                clip.displayName = "受击盒";
            }
            if (type.Equals(typeof(RoleTransformAsset)))
            {
                clip.displayName = "位移";
            }
            return base.CreatePlayable(graph, gameObject, clip);
        }
    }
}
